package formula.web.combo;

import java.util.List;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;

import formula.business.dao.DriverDao;
import formula.business.model.Team;

@ManagedBean(name = "teams")
@ViewScoped
public class TeamsCombo {

	private List<Team> teams;
	@ManagedProperty(value = "#{driverDao}")
	private DriverDao driverDao;

	public void setDriverDao(DriverDao driverDao) {
		this.driverDao = driverDao;
	}

	@PostConstruct
	public void prepare() {
		teams = this.driverDao.selectAll(Team.class);
	}

	public List<Team> getList() {
		return teams;
	}
}
